'use strict';
exports.main = async (event, context) => {
  const db = uniCloud.database()
  
  try {
    // 查询饲养指南列表
    const guides = await db.collection('care_guides')
      .orderBy('createTime', 'desc')
      .get()
    
    return {
      code: 200,
      message: '获取成功',
      data: guides.data
    }
    
  } catch (error) {
    console.error('获取饲养指南失败:', error)
    return {
      code: 500,
      message: error.message || '获取失败'
    }
  }
} 